package com.firstsource.networking.ip.tracker.data.entities;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Entity;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

@Entity
@Table(name="vlans")
public class VLAN implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="idx")
	@GeneratedValue(generator="VlanIndexSequence")
	@GenericGenerator(
				name="VlanIndexSequence",
				strategy="seqhilo",
				parameters={
						@Parameter(name="max_lo", value="1"),
						@Parameter(name="sequence", value="vlan_idx_seq")
				}
			)
	private int idx = 0 ;

	@Column(name="vlan_id")
	private int vlanId = 0 ;

	@Column(name="description")
	private String description ;

	@ManyToOne
	@JoinColumn(name="location_id")
	private Location location = null ;

	/**
	 * @return the idx
	 */
	public int getIdx() {
		return idx;
	}

	/**
	 * @param idx the idx to set
	 */
	public void setIdx(int idx) {
		this.idx = idx;
	}

	/**
	 * @return the vlanId
	 */
	public int getVlanId() {
		return vlanId;
	}

	/**
	 * @param vlanId the vlanId to set
	 */
	public void setVlanId(int vlanId) {
		this.vlanId = vlanId;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

	public Location getLocation() {
		return location;
	}
}
